package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.SCatalogClassMapper;
import com.education.welco.pojo.SCatalogClass;
import com.education.welco.service.ISCatalogClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 备课分享班级 服务层实现
 *
 * @author d
 * @date 2020-05-11
 */
@Service
public class SCatalogClassServiceImpl implements ISCatalogClassService {

    @Autowired
    private SCatalogClassMapper sCatalogClassMapper;


    /**
     * 查询备课分享班级信息
     *
     * @param catalogId 备课分享班级ID
     * @return 备课分享班级信息
     */
    @Override
    public List<Integer> selectSCatalogClassByCatalogId(Integer catalogId) {
        return sCatalogClassMapper.selectSCatalogClassByCatalogId(catalogId);
    }

    /**
     * 查询备课分享班级信息
     *
     * @param id 备课分享班级ID
     * @return 备课分享班级信息
     */
    @Override
    public SCatalogClass selectSCatalogClassById(Integer id) {
        return sCatalogClassMapper.selectSCatalogClassById(id);
    }

    /**
     * 查询备课分享班级列表
     *
     * @param sCatalogClass 备课分享班级信息
     * @return 备课分享班级集合
     */
    @Override
    public List<SCatalogClass> selectSCatalogClassList(SCatalogClass sCatalogClass) {
        return sCatalogClassMapper.selectSCatalogClassList(sCatalogClass);
    }

    /**
     * 新增备课分享班级
     *
     * @param sCatalogClass 备课分享班级信息
     * @return 结果
     */
    @Override
    public int insertSCatalogClass(SCatalogClass sCatalogClass) {
        return sCatalogClassMapper.insertSCatalogClass(sCatalogClass);
    }

    /**
     * 修改备课分享班级
     *
     * @param sCatalogClass 备课分享班级信息
     * @return 结果
     */
    @Override
    public int updateSCatalogClass(SCatalogClass sCatalogClass) {
        return sCatalogClassMapper.updateSCatalogClass(sCatalogClass);
    }

    @Override
    public int deleteSCatalogClassByCatalogId(Integer catalogId) {
        return sCatalogClassMapper.deleteSCatalogClassByCatalogId(catalogId);
    }

    /**
     * 删除备课分享班级对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSCatalogClassByIds(String ids) {
        return sCatalogClassMapper.deleteSCatalogClassByIds(Convert.toStrArray(ids));
    }
}